﻿// 客户(公司)下拉框
Ext.define('CompanyInfoModel', {
    extend: 'Ext.data.Model',
    fields: [
        "Id"
		, "ChineseFullName"   //企业中文名称
		, "ChineseShortName"   //企业中文简称
		, "EnglishFullName"   //企业英文全称
		, "EnglishShortName"   //企业英文简称
		, "BankNumber"   //工商注册号
		, "RegisterRoom"   //注册地
		, "Remark"   //备注
		, "Property"   //性质
		, { name: "Scope", type: "int"}   //规模
		, "HomePage"   //主页
		, "HigherUnit"   //上级单位
		, "UnderGroup"   //所属集团
		, "WorkPlace"   //办公所在地
		, "CompanyPlace"   //公司所在地
		, "Other"   //其他业务信息
        , 'UserID'//服务人员ID
        , 'UserName'//服务人员名称
	],
    idProperty: "Id"
});

Ext.define("SHApp.EmployeeInfo.BasicInfo.CompanyComboBox", {
    extend: "BLBTSystem.CmbData",
    alias: "widget.companyComboBox",
    dataUrl: "api/companyinfoQ?format=json",
    model: "CompanyInfoModel",
    matchFieldWidth: false,
    sorters: [{
        property: 'ChineseFullName',
        direction: 'ASC'
    }],
    listConfig: {
        resizable: true,
        width: 300
    },
    minChars: 1,
    valueField: "Id",
    displayField: "ChineseFullName",
    maxLength: 100,
    forceSelection: false,
    initComponent: function () {
        Ext.apply(this);
        this.callParent(arguments);
    },
    loadByGroup: function (groupName) {
        this.dataUrl = "api/companyinfoQ?format=json&ChineseFullName=" + encodeURIComponent(groupName);
        this.reLoadData();
    }
});
